<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="../../currency/layer.html" %>
    <script type="text/javascript">
    var roleEdit ={
    	sumbit:function (){
    		_linwq_borderColor("rName");
    		_linwq_borderColor("rDescribe");
    		_linwq_borderColor("rGrade");
    		$("#msg").html('');
    		var param={
    				rId:'${role.rId}',
    				rName:$("#rName").val(),
    				rDescribe:$("#rDescribe").val(),
    				rGrade:$("#rGrade").val()
    		}
    		if(_linwq_trim(param.rName)==''){
    			_linwq_borderColor("rName","red");
    			$("#msg").html("角色名格式有误！");
    		}else if(_linwq_trim(param.rDescribe)==''){
    			_linwq_borderColor("rDescribe","red");
    			$("#msg").html("角色描述格式有误！");
    		}else if(_linwq_trim(param.rGrade)==''){
    			_linwq_borderColor("rGrade","red");
    			$("#msg").html("角色权限格式有误！");
    		}else{
    			var msg ;
    			var msg1 ;
    			if(param.rId){
    				msg = "确认保存修改的角色信息？";//编辑
    				msg1 = "角色信息修改成功";
    			}else{
    				msg = "确认新增改角色信息？";//新增
    				msg1 = "角色信息添加成功";
    			}
    			_linwq_confirm(msg,"确认","取消",function(){
	    			_linwq_ajax("/role/roleSave.action",param,'text',function(data){
		    			if(data=="success"){
		    				var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
		    				parent.layer.msg(msg1,{icon:1});
		    				parent.layer.close(index); //再执行关闭   
		    			}
		    		}); 
    			});
    		}
    	}
    }	
    
	</script>
			<div class="page-wrap">
			<!--开始::内容-->
				<section class="page-hd">
					<header>
						<h2 class="title">表单结构展示</h2>
						<p class="title-description">
							两列式表单结构，一般针对产品详情，文章详情应用。
						</p>
					</header>
					<hr>
				</section>
					<div class="form-group-col-2">
						<div class="form-label">角色名称：</div>
						<div class="form-cont">
							<input type="text" id="rName" placeholder="角色名称..." value="${role.rName }" class="form-control form-boxed">
						</div>
					</div>
					<div class="form-group-col-2">
						<div class="form-label">角色描述：</div>
						<div class="form-cont">
							<textarea id="rDescribe" class="form-control form-boxed" style="resize:none;">${role.rDescribe}</textarea>
						</div>
					</div>
					<div class="form-group-col-2">
						<div class="form-label">角色等级：</div>
							<div class="form-cont">
								<input type="text" id="rGrade" placeholder="角色等级..." value="${role.rGrade }" class="form-control form-boxed">
							</div>
						</div>
					<div class="form-group-col-2">
						<div class="form-label"></div>
						<div class="form-cont">
							<input type="button" class="btn btn-primary" value="提交表单" onclick="roleEdit.sumbit()"/>
							<span style="color: red;" id="msg"/>
						</div>
					</div>
				<!--开始::结束-->
			</div>
